package com.example.demo.vo;

import com.baomidou.mybatisplus.core.metadata.IPage;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.List;

/**
 * 说明：
 *
 * @author 钟波dellNotebook
 * @since 2025年03月17日 星期一 22:48:49
 */
@Data
@NoArgsConstructor
public class PageVo<T> {

    private Long page;
    private Long pageSize;
    private Long pageTotal;
    private Long total;
    private List<T> records;

    public PageVo(IPage<T> iPage) {
        this.page = iPage.getCurrent();
        this.pageSize = iPage.getSize();
        this.pageTotal = iPage.getPages();
        this.total = iPage.getTotal();
        this.records = iPage.getRecords();
    }

    public Long getPage() {
        return page;
    }

    public void setPage(Long page) {
        this.page = page;
    }

    public Long getPageSize() {
        return pageSize;
    }

    public void setPageSize(Long pageSize) {
        this.pageSize = pageSize;
    }

    public Long getPageTotal() {
        return pageTotal;
    }

    public void setPageTotal(Long pageTotal) {
        this.pageTotal = pageTotal;
    }

    public Long getTotal() {
        return total;
    }

    public void setTotal(Long total) {
        this.total = total;
    }

    public List<T> getRecords() {
        return records;
    }

    public void setRecords(List<T> records) {
        this.records = records;
    }
}
